The present invention relates to timing recovery, and more particularly, to timing recovery methods and systems for a received data stream carrying data packets.
In digital data transmission technology, timestamps are fundamental as to controlling timing of the digital data, especially in real-time audio/video systems. For example, the Moving Picture Experts Group (MPEG) standard utilizes timestamps called program clock references (PCRs) to achieve audio/video synchronization between a source end and a destination end. Specifically speaking, in the MPEG-2 standard, at least one program clock reference (PCR), i.e. a timestamp, per 100 milliseconds is inserted into a data stream carrying data packets to ensure that the original timing of the data packets can be preserved at the destination end.
At the source end, PCR values are typically generated and thus incremented with a standard clock rate of 27 MHz complying with the MPEG-2 standard. Specifically, a PCR value is determined as a count number generated by a local clock of the source end having frequency of 27 MHz at the timing when the data packet corresponding to the PCR is being output from the source end. When the data stream carrying data packets output from the source end is transmitted to the destination end, the PCRs can be extracted as a means to recover timing of the data stream. Specifically speaking, the PCR values are utilized to adjust a local clock of the destination end, where the data stream are processed, such as decoded, demultiplexed, transmitted, etc, according to the adjusted local clock, thereby achieving clock synchronization between the source end and the destination end. In some implementations, the PCR values are utilized to adjust the throughput of receiving end modules, such as the video and/or audio output throughput. A simple and well-known synchronization technique is to compute a difference value between the PCR values and the counted number of clock cycles of the local clock at the destination end, and then utilize the difference value as a feedback parameter to modify the local clock at the destination using a conventional voltage-controlled crystal oscillator (VCXO) circuit.
In most cases, the data stream is not transmitted directly from the source end to the destination end but via a transmission channel. Theoretically, the transmission channel is transparent both to the source end and the destination end, and typically has its own timing control mechanism. Not only the transmission channel operates with a different clock rate from that of the source end or the destination end, but also the transmission channel utilizes another timestamp to control timing of the data stream entering and leaving the transmission channel. The reason beneath that is due to limitation of the bandwidth of the transmission channel. Specifically speaking, the total amount of data packets allowed to be transmitted via the transmission channel at a specific moment has a maximum limit, so the data packets can be transmitted only when the bandwidth of the transmission channel is still available. In other words, the data packets have to wait if the bandwidth is fully occupied and not available at this moment. Therefore, the predetermined time interval between any two data packets may be changed after the data packets enter into the transmission channel. Some jitter will be introduced and the arriving time of the data packets at the destination end will not match the intended time indexed by the PCR values. This is exactly why the transmission channel needs its own timing control mechanism.
To eliminate the “jitter” effect, the transmission channel conventionally utilizes a timestamp and a buffer to deal with timing of the data stream. For example, if the data stream of data packets is transmitted from the source end to the destination end through an Institute of Electrical and Electronics Engineers (IEEE) 1394 serial bus, each data packet will be attached with a source packet header (SPH) containing a timestamp complying with the IEC 61883 standard. Specifically speaking, the timestamp is determined as a count number generated by a channel clock having frequency of 50 MHz of the transmission channel at the source end at the timing when the data packet corresponding to the timestamp is entering into the transmission channel. Additionally, IEC 61883 standard utilizes a first in first out (FIFO) buffer to store the data packets entering into the transmission channel. The data packet waits in the FIFO buffer and is not sent out until its timestamp indicating an intended delivery time meets the value of a channel timer at the destination end. Therefore, after the data packets leave the transmission channel and arrive at the destination end, the time interval between any two data packets can be modified to be the original value at the source end.
By this method, however, the hardware cost would be high since a large FIFO is necessary for data buffering. For example, a FIFO of 3264 bytes is typically recommended in a digital video broadcasting (DVB) system for a MPEG-2 transport stream to transmit through an IEEE 1394 serial bus. It would be beneficial to eliminate the FIFO buffer required for jitter compensation, thereby reducing the hardware cost.